* Figure 1
use "./data/publications.dta", clear
createvarspub
bys article_id: keep if _n==1
collapse (count) total=article_id (sum) tnational tportpub tpfaonly, by(year)
keep if year>1999
label var total "All articles"
label var tnational "Portuguese institutions"
label var tportpub "Core institutions"
label var tpfaonly "Foreign institutions"
* Overall articles over the years - Count
tsset year
twoway ///
(tsline total, lwidth(medium) lpattern(dash)) /// 
(tsline tnational, lwidth(medium) lpattern(shortdash_dot_dot)) /// 
(tsline tportpub, lwidth(medium)) ///
(tsline tpfaonly, lwidth(medium) lpattern(dash_dot_dot)), /// 
ytitle(Number of articles) graphregion(fcolor(white)) ///
legend(region(color(white))) scheme(sj)
graph export ./figures/fig1.pdf, replace
